package com.iworkh.spring.aop.xml.biz.service;

import com.iworkh.spring.aop.xml.biz.domain.entity.Book;

/**
 * book业务
 *
 * @author: iworkh-沐雨云楼
 * @date: 2019-12-19
 */

public class BookService implements IService<Book> {
    @Override
    public void save(Book book) {
        System.out.println("BookService***save");
    }

    @Override
    public Book get(String id) {
        System.out.println("BookService***get");
        return Book.builder().author("iworkh").bookName("spring手册").count(200).price(58.0).build();
    }

    @Override
    public void delete(String id) {
        if (id == null) {
            throw new RuntimeException("必须设置id才能删除!");
        }

        System.out.println("BookService***delete");
    }
}
